package edu.sctu.practice.class01.zhangwang.assigns.assign03.question_03;

/**
 * Created by Z_W on 2015/10/24.
 */
public class Client {
    public static void main(String[] args) throws CloneNotSupportedException {
        Name name = new Name();
        name.setFirstName("张");
        name.setLastName("小");
        name.setMiddlName("明");

        CloneableCircle cloneable = new CloneableCircle();
        cloneable.setCreator(name);

        CloneableCircle cloneable2 = (CloneableCircle) cloneable.clone();

        cloneable2.getCreator().setLastName("明");
        cloneable2.getCreator().setMiddlName("小");
        cloneable2.getCreator().setFirstName("王");

        System.out.println(cloneable.getCreator().firstName + cloneable.getCreator().getMiddlName() + cloneable.getCreator().getLastName());
        System.out.println(cloneable2.getCreator().firstName + cloneable2.getCreator().getMiddlName() + cloneable2.getCreator().getLastName());
    }

}
